public abstract class SpaceOb{
	//Breytur
	private double posx;
	private double posy;
	private double velx;
	private double vely;
	private double faceAngle;
	private Shape ObShape;
	private boolean alive;
	
	//Default Constructor
	public SpaceOb(){
		setPosx(0.0);
		setPosy(0.0);
		setVelx(0.0);
		setVely(0.0);
		setFaceAngle(Math.PI/2);
		setObShape(null);
		setAlive(false);
	}
	public SpaceOb(boolean bbb){
		setPosx(0.0);
		setPosy(0.0);
		setVelx(0.0);
		setVely(0.0);
		setFaceAngle(Math.PI/2);
		setObShape(null);
		setAlive(bbb);
	}
	public SpaceOb(double blax, double blay){
		setPosx(blax);
		setPosy(blay);
		setVelx(0.0);
		setVely(0.0);
		setFaceAngle(0.0);
		setObShape(null);
		setAlive(false);
	}
	
	
	//Get breytur
	public double getPosx(){return posx;}
	
	public double getPosy(){return posy;}
	
	public double getVelx(){return velx;}
	
	public double getVely(){return vely;}
	
	public double getFaceAngle(){return faceAngle;}
	
	public Shape getObShape(){return ObShape;}
	
	public boolean getAlive(){return alive;}
	
	//Mutators
	
	public void setPosx(double x){
		posx = x;
	}
	
	public void setPosy(double x){
		posy = x;
	}
	
	public void incPosx(double x){
		posx += x;
	}
	
	public void incPosy(double x){
		posy += x;
	}
	
	public void setVelx(double x){
		velx = x;
	}
	
		public void setVely(double x){
		vely = x;
	}
	
	public void incVelx(double x){
		velx +=x;
	}
	
	public void incVely(double x){
		vely +=x;
	}
	
	private double fixAngle(double x){
		while(x<0){x+= 2*Math.PI;}
		while(x>2*Math.PI){x-=2*Math.PI;}
		return x;
	}
	
	public void setFaceAngle(double x){
		faceAngle=fixAngle(x);
	}
	
	public void incFaceAngle(double x){
		faceAngle=fixAngle(faceAngle+x);
	}
	
	public void setObShape(Shape s){
		ObShape=s;
	}
	
	public void setAlive(boolean x){
		alive=x;
	}
	
	//Almenn föll
	public abstract void update();
	
	public abstract void draw();
}